Skip to content

fix: show default theme author/version on Settings > Themes (#1466) - #1470

Merged
rumblefrog merged 3 commits into
mainfrom
fix/1466-theme-settings-metadata
May 26, 2026
Merged

fix: show default theme author/version on Settings > Themes (#1466)#1470
rumblefrog merged 3 commits into
mainfrom
fix/1466-theme-settings-metadata

Conversation

@rumblefrog

Copy link
Copy Markdown
Member

Summary

  • Fixes theme card metadata on Admin → Settings → Themes showing by Unknown · v? for the shipped default theme.
  • ThemeConf::parseDefine() reads both single- and double-quoted define() string literals from theme.conf.php without executing the file (the default manifest uses single quotes; fork themes often use double quotes per the docs).

Root cause

The discovery loop regex only matched double-quoted values. The default web/themes/default/theme.conf.php uses single quotes, so author/version fell through to the Unknown / ? defaults.

Test plan

  • ThemeConfParseTest — default manifest + double-quoted sample
  • ./sbpp.sh test --filter=ThemeConfParseTest
  • Manual: open ?p=admin&c=settings&section=themes and confirm the default card reads by SourceBans++ Dev Team · v2.0.0

Fixes #1466

…#1466)

The theme discovery regex only matched double-quoted define() values, so
the default theme card showed "by Unknown · v?" despite valid manifest data.
- Discriminate single- vs double-quoted define() branches so empty "" does
  not read an unset capture (Settings fatal).
- Support escaped apostrophes in single-quoted values.
- Sanitize theme_link (http/https only) and screenshot filename (basename).
- Expand ThemeConfParseTest; document picker vs API include in system.php,
  ARCHITECTURE.md, translating.md, and AGENTS.md.
@rumblefrog
rumblefrog added this pull request to the merge queue May 26, 2026
Merged via the queue into main with commit 65497eb May 26, 2026
9 checks passed
@rumblefrog
rumblefrog deleted the fix/1466-theme-settings-metadata branch May 26, 2026 17:36
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default theme's details not pulled through to Admin Settings page

1 participant